home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / gas_251.zip / bin_251 / opcodes / configure.in < prev    next >
Text File  |  1994-10-04  |  4KB  |  147 lines

  1. # This file is a shell script that supplies the information necessary
  2. # to tailor a template configure script into the configure script
  3. # appropriate for this directory.  For more information, check any
  4. # existing configure script.
  5.  
  6. srctrigger=z8k-dis.c
  7. srcname="opcodes"
  8.  
  9. # per-host:
  10.  
  11. . ${srcdir}/../bfd/configure.host
  12.  
  13. # Set up to make a link between the host's include file and "sysdep.h".
  14. files="../bfd/hosts/${my_host}.h"
  15. links="sysdep.h"
  16.  
  17. if [ ! -f ${srcdir}/${files} ] ; then
  18.     files=../bfd/hosts/std-host.h
  19.     echo "[${srcname} has no specific support for host ${host} -- using std-host]"
  20. fi
  21.  
  22. host_makefile_frag=
  23. if [ -f ${srcdir}/../bfd/config/${my_host}.mh ] ; then
  24.     host_makefile_frag=../bfd/config/${my_host}.mh
  25. fi
  26.  
  27. # per-target:
  28.  
  29. # Canonicalize the secondary target names.
  30. if [ -n "$enable_targets" ]; then
  31.     for targ in `echo $enable_targets | sed 's/,/ /g'`
  32.     do
  33.     result=`$configsub $targ 2>/dev/null`
  34.     if [ -n "$result" ]; then
  35.         canon_targets="$canon_targets $result"
  36.     else
  37.         # Allow targets that config.sub doesn't recognize, like "all".
  38.         canon_targets="$canon_targets $targ"
  39.     fi
  40.     done
  41. fi
  42.  
  43. all_targets=false
  44.  
  45. for targ in $target $canon_targets
  46. do
  47.     bfd_target=`${config_shell} $srcdir/../bfd/config.bfd $targ`
  48.  
  49.     if [ "x$bfd_target" = "xall" ]; then
  50.         all_targets=true
  51.     else
  52.     if [ ! -f ${srcdir}/../bfd/config/${bfd_target}.mt ] ; then
  53.         echo '***' No file ${srcdir}/../bfd/config/${bfd_target}.mt 1>&2
  54.         echo '***' opcodes does not support target ${bfd_target} 1>&2
  55.         echo '***' Look in bfd/config.bfd for supported targets 1>&2
  56.         exit 1
  57.     fi
  58.  
  59.     if [ "x$targ" = "x$target" ]; then
  60.         target_makefile_frag=${srcdir}/../bfd/config/${bfd_target}.mt
  61.     else
  62.         target_extra_frags="$target_extra_frags ${srcdir}/../bfd/config/${bfd_target}.mt"
  63.     fi
  64.     fi
  65. done
  66.  
  67. # We don't do any links based on the target system, just makefile config.
  68.  
  69. # post-target:
  70.  
  71. rm -f Makefile.tmp Makefile.2
  72. mv Makefile Makefile.tmp
  73.  
  74. if [ x${all_targets} = xfalse ]; then
  75.  
  76.     allfrags="$target_makefile_frag $target_extra_frags"
  77.  
  78.     # The architectures in all the configured targets.
  79.     SELECT_ARCHITECTURES=`sed -n '
  80.     s/SELECT_ARCHITECTURES[     ]*=[     ]*//p
  81.     ' $allfrags`
  82.  
  83.     # Target architecture .o files.
  84.     ta=
  85.  
  86.     for arch in $SELECT_ARCHITECTURES
  87.     do
  88.     ad=`echo $arch | sed -e s/bfd_//g -e s/_arch//g`
  89.     archdefs="$archdefs -DARCH_$ad"
  90.     case "$arch" in
  91.     bfd_a29k_arch)        ta="$ta a29k-dis.o" ;;
  92.     bfd_alpha_arch)        ta="$ta alpha-dis.o" ;;
  93.     bfd_arm_arch)        ta="$ta arm-dis.o" ;;
  94.     bfd_h8300_arch)        ta="$ta h8300-dis.o" ;;
  95.     bfd_h8500_arch)        ta="$ta h8500-dis.o" ;;
  96.     bfd_hppa_arch)        ta="$ta hppa-dis.o" ;;
  97.     bfd_i386_arch)        ta="$ta i386-dis.o" ;;
  98.     bfd_i960_arch)        ta="$ta i960-dis.o" ;;
  99.     bfd_m68k_arch)        ta="$ta m68k-dis.o" ;;
  100.     bfd_m88k_arch)        ta="$ta m88k-dis.o" ;;
  101.     bfd_mips_arch)        ta="$ta mips-dis.o mips-opc.o" ;;
  102.     bfd_ns32k_arch)        ta="$ta ns32k-dis.o" ;;
  103.     bfd_powerpc_arch)    ta="$ta ppc-dis.o ppc-opc.o" ;;
  104.     bfd_rs6000_arch)    ta="$ta ppc-dis.o ppc-opc.o" ;;
  105.     bfd_sh_arch)        ta="$ta sh-dis.o" ;;
  106.     bfd_sparc_arch)        ta="$ta sparc-dis.o sparc-opc.o" ;;
  107.     bfd_vax_arch)        ;;
  108.     bfd_we32k_arch)        ;;
  109.     bfd_z8k_arch)        ta="$ta z8k-dis.o" ;;
  110.  
  111.     "")            ;;
  112.     *) echo "*** unknown target architecture $arch" 1>&2; exit 1 ;;
  113.     esac
  114.     done
  115.  
  116.     # Weed out duplicate .o files.
  117.     f=""
  118.     for i in $ta ; do
  119.     case " $f " in
  120.     *" $i "*) ;;
  121.     *) f="$f $i" ;;
  122.     esac
  123.     done
  124.     ta="$f"
  125.  
  126.     # And duplicate -D flags.
  127.     f=""
  128.     for i in $archdefs ; do
  129.     case " $f " in
  130.     *" $i "*) ;;
  131.     *) f="$f $i" ;;
  132.     esac
  133.     done
  134.     archdefs="$f"
  135.  
  136.     echo "ARCHDEFS = $archdefs"            >> Makefile.2
  137.     echo "BFD_MACHINES = $ta"            >> Makefile.2
  138.  
  139. else    # all_targets is true
  140.     echo 'ARCHDEFS = -DARCH_all'        >> Makefile.2
  141.     echo 'BFD_MACHINES = $(ALL_MACHINES)'    >> Makefile.2
  142. fi    # all_targets is true
  143.  
  144. cat Makefile.tmp >> Makefile.2
  145. rm -f Makefile.tmp
  146. mv Makefile.2 Makefile
  147.